<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>收支管理</title>
</head>
<lui:context/>
<u:View basePath="/res-datum/expense" userJS="expense" userCSS="expense" delayLoadJs="false">
<body>
<lui:boards>
    <lui:board width="100%" boardTitle="收支管理">
        <form id="expenseFrm" class='m-cust'>
        	<sys:dropCodeSet codeTypes="consumeType,consumeChannel,consumeAddress,isCountTime,isInstalment,recommendLevel" id="codeSet"/>
        	<div class="form-group row m-narrow">
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="productName" class="input-group-addon">商品名称</label>
					    <input name="productName" id="productName" type="text" class="form-control" maxlength="100">
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="searchConsumeTime" class="input-group-addon">消费时间</label>
					    <lui:datepicker name="searchConsumeTime" dateType="month" id="searchConsumeTime" dateFormat="yyyy-mm" defaultNow="true" 
					    	endDate="${u:getCurrTimeChangeNthDayDate(0,'yyyy-MM-dd HH:mm:ss') }"/>
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="consumeType" class="input-group-addon">消费类型</label>
						<lui:dropList id="consumeType" name="consumeType" className="form-control m-input" dropValues="codeSet.consumeType" 
							showSelectAll="true" showSelectName="请选择"/>
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="consumeChannel" class="input-group-addon">消费渠道</label>
					    <lui:dropList id="consumeChannel" name="consumeChannel" className="form-control m-input" dropValues="codeSet.consumeChannel" 
							showSelectAll="true" showSelectName="请选择"/>
					</div>
			    </div>
			</div>
			<div class="form-group row m-narrow">
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="consumeAddress" class="input-group-addon">消费地点</label>
					    <lui:dropList id="consumeAddress" name="consumeAddress" className="form-control m-input" dropValues="codeSet.consumeAddress" 
							showSelectAll="true" showSelectName="请选择"/>
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="minConsumeAmount" class="input-group-addon">消费金额</label>
				    	<input name="minConsumeAmount" id="minConsumeAmount" type="number" class="form-control" step="0.01" min="0">
					    <label for="maxConsumeAmount" class="input-group-addon">至</label>
				    	<input name="maxConsumeAmount" id="maxConsumeAmount" type="number" class="form-control" step="0.01" min="0">
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="isCountTime" class="input-group-addon">是否计时</label>
					    <lui:dropList id="isCountTime" name="isCountTime" className="form-control m-input" dropValues="codeSet.isCountTime" 
							showSelectAll="true" showSelectName="请选择"/>
					</div>
			    </div>
			    <div class="col-sm-3 col-md-3 col-xs-3">
			    	<div class="input-group">
					    <label for="isInstalment" class="input-group-addon">是否分期</label>
					    <lui:dropList id="isInstalment" name="isInstalment" className="form-control m-input" dropValues="codeSet.isInstalment" 
							showSelectAll="true" showSelectName="请选择" />
					</div>
			    </div>
			</div>
			<div class="form-horizontal">
				<div class="form-group">
					<div class="col-md-3 col-sm-3">
						<div class="btn-group" id="buttonGro">
							<button type="button" class="btn btn-primary" onclick="ExpensePage.queryByCondition()"><i class='fa fa-fw fa-search'></i>查询</button>
							<button type="button" class="btn btn-info" onclick="ExpensePage.openAddDialog()"><i class='fa fa-fw fa-plus'></i>新增</button>
							<button type="reset" class="btn btn-default"><i class='fa fa-fw fa-repeat'></i>重置</button>
						</div>
					</div>
					<div class="col-md-9 col-sm-9 t-statistics-bar">
						<div class="col-md-3 col-sm-3">
							<div class="t-statistics-bar-item">
								<span>消费总额：</span>
								<input name="sumConsumeAmount" value="--" class="m-color-dark-red" readonly="readonly">
							</div>
						</div>
						<div class="col-md-3 col-sm-3">
							<div class="t-statistics-bar-item">
								<span>金额统计：</span>
								<input name="countConsumeAmountSelect" value="--" class="m-color-dark-red" readonly="readonly">
							</div>
						</div>
						<div class="col-md-6 col-sm-6">
							<div class="t-statistics-bar-item">
								<span>本月未还/已还商品贷款：</span>
								<div class="t-statistics-bar-wrap">
									<div class="t-statistics-bar-inputitem">
										<input name="mthWaitRepayAmount" value="--" class="m-color-dark-red" readonly="readonly">
									</div>
									<div class="t-statistics-bar-inputitem">
										<input name="mthHadRepayAmount" value="--" class="m-color-dark-red" readonly="readonly">
									</div>
								</div>
								<button type="button" onclick="ExpensePage.viewMthInstalmentDetail()" title="查看本月和下月分期详情"><i class='fa fa-fw fa-eye'></i></button>
							</div>
						</div>
					</div>
				</div>
			</div>
			<u:dropListView id="dropView_oper">
			    <u:dropView name="update" template="edit" onClick="ExpensePage.update" title="修改"/>
			    <u:dropView name="delete" template="delete" onClick="ExpensePage.delete" title="删除"/>
			    <u:dropView name="view" template="view" onClick="ExpensePage.view" title="查看详情"/>
			</u:dropListView>
			<u:dropList id="drop_isCountTime">
				<u:dropItem value="01" text="ExpensePage.isCountTime"/>
				<u:dropItem value="02" text="否"/>
			</u:dropList>
			<u:dataSet id="expenseInfoSet" idField="id">
				<u:dataField name="id" display="ID" visiable="false"/>
				<u:dataField name="productName" display="商品名称" align="left" width="180px"/>
				<u:dataField name="productAmount" display="商品金额" visiable="false"/>
				<u:dataField name="consumeAmount" display="消费金额" width="80px"/>
				<u:dataField name="consumeTime" display="消费时间" width="80px"/>
				<u:dataField name="consumeChannel" display="消费渠道" dropdown="codeSet.consumeChannel" width="60px"/>
				<u:dataField name="consumeType" display="消费类型" dropdown="codeSet.consumeType" width="200px" align="left"/>
				<u:dataField name="consumeAddress" display="消费地点" dropdown="codeSet.consumeAddress"/>
				<u:dataField name="isCountTime" display="计时信息" dropdown="drop_isCountTime" width="100px"/>
				<u:dataField name="endCountTime" display="废弃时间" visiable="false"/>
				<u:dataField name="isInstalment" display="分期信息" dropdown="codeSet.isInstalment"/>
				<u:dataField name="installNum" display="分期期数" visiable="false"/>
				<u:dataField name="mthRepayAmount" display="月还款金额" visiable="false"/>
				<u:dataField name="createTime" display="创建时间" width="140px" visiable="false"/>
				<u:dataField name="recommend" display="推荐系数" dropdown="codeSet.recommendLevel" width="60px"/>
				<u:dataField name="updateTime" display="更新时间" width="140px"/>
				<u:dataField name="userId" display="用户ID" visiable="false"/>
				<u:dataField name="userName" display="用户姓名" visiable="false"/>
				<u:dataField name="remark" display="备注" width="180px" align="left"/>
				<u:dataField name="oper" display="操作" dropView="dropView_oper"/>
				<u:dataField name="mthRepayDate" display="月还款日" visiable="false"/>
				<u:dataField name="firstRepayDate" display="首次还款日" visiable="false"/>
			</u:dataSet>
			<!-- 获取用户信息列表ajax -->
			<lui:ajax id="findExpenseInfoAjax" url="${ctx }/expense/find/page" formQuery="#expenseFrm" />
			<!-- 获取统计信息 -->
			<lui:ajax id="findStatisticInfoAjax" url="${ctx }/expense/find/statistic/info" formQuery="#expenseFrm" silent="true" type="post"
				onSuccess="ExpensePage.findStatisticInfoSucc" contentType="application/x-www-form-urlencoded"/>
			<lui:datatable id="datatable" ajax="findExpenseInfoAjax" sortable="true" pagination="pagination" dataset="expenseInfoSet" checkable="true"
			    multiple="true" cutLine="true" tip="true" onChecksChanged="ExpensePage.onChecksChanged" afterReady="ExpensePage.afterReady"
			    onDoubleClick="ExpensePage.onDoubleClick"/>
			<lui:pagination datatable="datatable" id="pagination" pageSize="14" pageChoice="14" showPageChoice="false"/>
			<lui:ajax id="deleteByIdAjax" url="${ctx }/expense/delete/id/" onSuccess="ExpensePage.onDeleteSucc"/>
        </form>
    </lui:board>
</lui:boards>
</body>
</u:View>
</html>